﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace _09_Tetris
{
    internal class Input
    {
        ConsoleKeyInfo keyInfo;

        public Input()
        {
            
        }
        public void Update()
        {
            keyInfo = default;
            if (Console.KeyAvailable)  // 如果我按下了按键
            {
                keyInfo = Console.ReadKey(true);
            }
        }

        public bool IsKeyPressed(ConsoleKey key)
        {

            return key == keyInfo.Key;
        }
    }
}
